package com.administrator.customviewtest.test3;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.administrator.customviewtest.R;
import com.administrator.customviewtest.bean.Items;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import lsp.com.library.FlowLayout;

/**
 * Created by Administrator on 2017/3/3.
 */

public class RecyclerViewTest extends AppCompatActivity {

    private LinearLayout searchLl;
    private ImageView searchImg;
    private View searchView;
    private TextView searchTv;
    private EditText searchEdt;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        searchLl = (LinearLayout) findViewById(R.id.ll_search);
        searchImg = (ImageView) findViewById(R.id.img_search);
        searchView = findViewById(R.id.view_search);
        searchTv = (TextView) findViewById(R.id.tv_search);
        searchEdt = (EditText) findViewById(R.id.edt_search);

        searchTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(RecyclerViewTest.this, "fdsfds", Toast.LENGTH_SHORT).show();
            }
        });

        searchTv.setClickable(false);

        searchEdt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View view, boolean b) {
                if (b) {
                    searchTv.setClickable(true);
                    searchView.setVisibility(View.VISIBLE);
                } else {
                    searchTv.setClickable(false);
                    searchView.setVisibility(View.GONE);
                }
            }
        });

    }

}
